package Main

import (
	"math/big"
	"strings"

	"github.com/FISCO-BCOS/go-sdk/abi"
	"github.com/FISCO-BCOS/go-sdk/abi/bind"
	"github.com/FISCO-BCOS/go-sdk/core/types"
	"github.com/FISCO-BCOS/go-sdk/event"
	ethereum "github.com/ethereum/go-ethereum"
	"github.com/ethereum/go-ethereum/common"
)

// Reference imports to suppress errors if they are not otherwise used.
var (
	_ = big.NewInt
	_ = strings.NewReader
	_ = ethereum.NotFound
	_ = abi.U256
	_ = bind.Bind
	_ = common.Big1
	_ = types.BloomLookup
	_ = event.NewSubscription
)

// MainABI is the input ABI used to generate the binding from.
const MainABI = "[{\"constant\":false,\"inputs\":[{\"name\":\"userId\",\"type\":\"string\"},{\"name\":\"fileId\",\"type\":\"string\"},{\"name\":\"fileHash\",\"type\":\"string\"},{\"name\":\"fileSm3\",\"type\":\"string\"},{\"name\":\"fileMd5\",\"type\":\"string\"},{\"name\":\"timestamp\",\"type\":\"string\"}],\"name\":\"Add\",\"outputs\":[{\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"Name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_fileSm3\",\"type\":\"string\"}],\"name\":\"GetBySm3\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"Version\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_fileHash\",\"type\":\"string\"}],\"name\":\"GetByHash\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_fileId\",\"type\":\"string\"}],\"name\":\"GetById\",\"outputs\":[{\"name\":\"user\",\"type\":\"address\"},{\"name\":\"userId\",\"type\":\"string\"},{\"name\":\"fileId\",\"type\":\"string\"},{\"name\":\"fileHash\",\"type\":\"string\"},{\"name\":\"fileSm3\",\"type\":\"string\"},{\"name\":\"fileMd5\",\"type\":\"string\"},{\"name\":\"blkNum\",\"type\":\"uint256\"},{\"name\":\"timeStamp\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_fileIdHash\",\"type\":\"bytes32\"}],\"name\":\"GetByIdHash\",\"outputs\":[{\"name\":\"user\",\"type\":\"address\"},{\"name\":\"userId\",\"type\":\"string\"},{\"name\":\"fileId\",\"type\":\"string\"},{\"name\":\"fileHash\",\"type\":\"string\"},{\"name\":\"fileSm3\",\"type\":\"string\"},{\"name\":\"fileMd5\",\"type\":\"string\"},{\"name\":\"blkNum\",\"type\":\"uint256\"},{\"name\":\"timeStamp\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_fileMd5\",\"type\":\"string\"}],\"name\":\"GetByMd5\",\"outputs\":[{\"name\":\"\",\"type\":\"bytes32[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"name\":\"userAddr\",\"type\":\"address\"},{\"indexed\":true,\"name\":\"fileId\",\"type\":\"string\"},{\"indexed\":true,\"name\":\"fileHash\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"fileSm3\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"fileMd5\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"timestamp\",\"type\":\"string\"}],\"name\":\"New\",\"type\":\"event\"}]"

// MainBin is the compiled bytecode used for deploying new contracts.
var MainBin = "0x60806040526040805190810160405280601381526020017f50726f6f6620436f6e74726163742044656d6f000000000000000000000000008152506006908051906020019062000051929190620000b4565b506040805190810160405280600781526020017f56657220302e3100000000000000000000000000000000000000000000000000815250600790805190602001906200009f929190620000b4565b50348015620000ad57600080fd5b5062000163565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620000f757805160ff191683800117855562000128565b8280016001018555821562000128579182015b82811115620001275782518255916020019190600101906200010a565b5b5090506200013791906200013b565b5090565b6200016091905b808211156200015c57600081600090555060010162000142565b5090565b90565b612bff80620001736000396000f3fe608060405260043610610098576000357c010000000000000000000000000000000000000000000000000000000090048063cd16940b1161006b578063cd16940b146106ad578063d7b451ec146107ca578063e3b3655b14610b61578063f3a0f42a14610e6b57610098565b806368b7d4ae1461009d5780638052474d1461047057806399ac22f514610500578063bb62860d1461061d575b600080fd5b3480156100a957600080fd5b50610456600480360360c08110156100c057600080fd5b81019080803590602001906401000000008111156100dd57600080fd5b8201836020820111156100ef57600080fd5b8035906020019184600183028401116401000000008311171561011157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561017457600080fd5b82018360208201111561018657600080fd5b803590602001918460018302840111640100000000831117156101a857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561020b57600080fd5b82018360208201111561021d57600080fd5b8035906020019184600183028401116401000000008311171561023f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156102a257600080fd5b8201836020820111156102b457600080fd5b803590602001918460018302840111640100000000831117156102d657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561033957600080fd5b82018360208201111561034b57600080fd5b8035906020019184600183028401116401000000008311171561036d57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156103d057600080fd5b8201836020820111156103e257600080fd5b8035906020019184600183028401116401000000008311171561040457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610f88565b604051808215151515815260200191505060405180910390f35b34801561047c57600080fd5b50610485611313565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c55780820151818401526020810190506104aa565b50505050905090810190601f1680156104f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050c57600080fd5b506105c66004803603602081101561052357600080fd5b810190808035906020019064010000000081111561054057600080fd5b82018360208201111561055257600080fd5b8035906020019184600183028401116401000000008311171561057457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506113b5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106095780820151818401526020810190506105ee565b505050509050019250505060405180910390f35b34801561062957600080fd5b506106326113c7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610672578082015181840152602081019050610657565b50505050905090810190601f16801561069f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106b957600080fd5b50610773600480360360208110156106d057600080fd5b81019080803590602001906401000000008111156106ed57600080fd5b8201836020820111156106ff57600080fd5b8035906020019184600183028401116401000000008311171561072157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611469565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156107b657808201518184015260208101905061079b565b505050509050019250505060405180910390f35b3480156107d657600080fd5b50610890600480360360208110156107ed57600080fd5b810190808035906020019064010000000081111561080a57600080fd5b82018360208201111561081c57600080fd5b8035906020019184600183028401116401000000008311171561083e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061147b565b604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018060200180602001806020018881526020018060200187810387528e818151815260200191508051906020019080838360005b8381101561091c578082015181840152602081019050610901565b50505050905090810190601f1680156109495780820380516001836020036101000a031916815260200191505b5087810386528d818151815260200191508051906020019080838360005b83811015610982578082015181840152602081019050610967565b50505050905090810190601f1680156109af5780820380516001836020036101000a031916815260200191505b5087810385528c818151815260200191508051906020019080838360005b838110156109e85780820151818401526020810190506109cd565b50505050905090810190601f168015610a155780820380516001836020036101000a031916815260200191505b5087810384528b818151815260200191508051906020019080838360005b83811015610a4e578082015181840152602081019050610a33565b50505050905090810190601f168015610a7b5780820380516001836020036101000a031916815260200191505b5087810383528a818151815260200191508051906020019080838360005b83811015610ab4578082015181840152602081019050610a99565b50505050905090810190601f168015610ae15780820380516001836020036101000a031916815260200191505b50878103825288818151815260200191508051906020019080838360005b83811015610b1a578082015181840152602081019050610aff565b50505050905090810190601f168015610b475780820380516001836020036101000a031916815260200191505b509e50505050505050505050505050505060405180910390f35b348015610b6d57600080fd5b50610b9a60048036036020811015610b8457600080fd5b810190808035906020019092919050505061155e565b604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001806020018060200180602001806020018881526020018060200187810387528e818151815260200191508051906020019080838360005b83811015610c26578082015181840152602081019050610c0b565b50505050905090810190601f168015610c535780820380516001836020036101000a031916815260200191505b5087810386528d818151815260200191508051906020019080838360005b83811015610c8c578082015181840152602081019050610c71565b50505050905090810190601f168015610cb95780820380516001836020036101000a031916815260200191505b5087810385528c818151815260200191508051906020019080838360005b83811015610cf2578082015181840152602081019050610cd7565b50505050905090810190601f168015610d1f5780820380516001836020036101000a031916815260200191505b5087810384528b818151815260200191508051906020019080838360005b83811015610d58578082015181840152602081019050610d3d565b50505050905090810190601f168015610d855780820380516001836020036101000a031916815260200191505b5087810383528a818151815260200191508051906020019080838360005b83811015610dbe578082015181840152602081019050610da3565b50505050905090810190601f168015610deb5780820380516001836020036101000a031916815260200191505b50878103825288818151815260200191508051906020019080838360005b83811015610e24578082015181840152602081019050610e09565b50505050905090810190601f168015610e515780820380516001836020036101000a031916815260200191505b509e50505050505050505050505050505060405180910390f35b348015610e7757600080fd5b50610f3160048036036020811015610e8e57600080fd5b8101908080359060200190640100000000811115610eab57600080fd5b820183602082011115610ebd57600080fd5b80359060200191846001830284011164010000000083111715610edf57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506115b0565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610f74578082015181840152602081019050610f59565b505050509050019250505060405180910390f35b6000610f9a610f956115c2565b6115ca565b15610fb257610fb087610fab6115c2565b611663565b505b610fc387610fbe6115c2565b611745565b1515611037576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f75736572206964206572726f720000000000000000000000000000000000000081525060200191505060405180910390fd5b6000439050611044612a5a565b60e0604051908101604052806110586115c2565b73ffffffffffffffffffffffffffffffffffffffff1681526020018981526020018881526020018781526020018681526020018581526020018381525090506110a8816110a36115c2565b611832565b50866040518082805190602001908083835b6020831015156110df57805182526020820191506020810190506020830392506110ba565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020886040518082805190602001908083835b602083101515611142578051825260208201915060208101905060208303925061111d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206111776115c2565b73ffffffffffffffffffffffffffffffffffffffff167ffa733ea4d235b0fd772498c8094e129240609c36cb4da6df273418366eb3c3d589898960405180806020018060200180602001848103845287818151815260200191508051906020019080838360005b838110156111f95780820151818401526020810190506111de565b50505050905090810190601f1680156112265780820380516001836020036101000a031916815260200191505b50848103835286818151815260200191508051906020019080838360005b8381101561125f578082015181840152602081019050611244565b50505050905090810190601f16801561128c5780820380516001836020036101000a031916815260200191505b50848103825285818151815260200191508051906020019080838360005b838110156112c55780820151818401526020810190506112aa565b50505050905090810190601f1680156112f25780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a46001925050509695505050505050565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113ab5780601f10611380576101008083540402835291602001916113ab565b820191906000526020600020905b81548152906001019060200180831161138e57829003601f168201915b5050505050905090565b60606113c082611e7b565b9050919050565b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561145f5780601f106114345761010080835404028352916020019161145f565b820191906000526020600020905b81548152906001019060200180831161144257829003601f168201915b5050505050905090565b606061147482611f7d565b9050919050565b60006060806060806060600060606000896040516020018080602001828103825283818151815260200191508051906020019080838360005b838110156114cf5780820151818401526020810190506114b4565b50505050905090810190601f1680156114fc5780820380516001836020036101000a031916815260200191505b50925050506040516020818303038152906040528051906020012090506115228161207f565b809350819450505061153381612155565b809850819950829a50839b50849d50505050505061155089612515565b975050919395975091939597565b60006060806060806060600060606115758961207f565b809250819350505061158689612155565b809750819850829950839a50849c5050505050506115a388612515565b9650919395975091939597565b60606115bb826125f8565b9050919050565b600033905090565b60008073ffffffffffffffffffffffffffffffffffffffff166000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050919050565b6000816000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101908051906020019061173a929190612aae565b506001905092915050565b600061182a6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561181f5780601f106117f45761010080835404028352916020019161181f565b820191906000526020600020905b81548152906001019060200180831161180257829003601f168201915b5050505050846126fa565b905092915050565b60008083602001516040516020018080602001828103825283818151815260200191508051906020019080838360005b8381101561187d578082015181840152602081019050611862565b50505050905090810190601f1680156118aa5780820380516001836020036101000a031916815260200191505b50925050506040516020818303038152906040528051906020012090506118d5818560000151612710565b15151561194a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f66696c652069642065786973742e00000000000000000000000000000000000081525060200191505060405180910390fd5b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154905084602001516000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600083815260200190815260200160002060000190805190602001906119fd929190612aae565b50611a5360016000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015461277890919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030181905550600085604001516040516020018080602001828103825283818151815260200191508051906020019080838360005b83811015611ae2578082015181840152602081019050611ac7565b50505050905090810190601f168015611b0f5780820380516001836020036101000a031916815260200191505b5092505050604051602081830303815290604052805190602001209050600086606001516040516020018080602001828103825283818151815260200191508051906020019080838360005b83811015611b76578082015181840152602081019050611b5b565b50505050905090810190601f168015611ba35780820380516001836020036101000a031916815260200191505b5092505050604051602081830303815290604052805190602001209050600087608001516040516020018080602001828103825283818151815260200191508051906020019080838360005b83811015611c0a578082015181840152602081019050611bef565b50505050905090810190601f168015611c375780820380516001836020036101000a031916815260200191505b509250505060405160208183030381529060405280519060200120905060018060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600087815260200190815260200160002060006101000a81548160ff021916908315150217905550600360008481526020019081526020016000208590806001815401808255809150509060018203906000526020600020016000909192909190915055506004600083815260200190815260200160002085908060018154018082558091505090600182039060005260206000200160009091929091909150555060056000828152602001908152602001600020859080600181540180825580915050906001820390600052602060002001600090919290919091505550876002600087815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506020820151816001019080519060200190611dea929190612b2e565b506040820151816002019080519060200190611e07929190612b2e565b506060820151816003019080519060200190611e24929190612b2e565b506080820151816004019080519060200190611e41929190612b2e565b5060a0820151816005019080519060200190611e5e929190612b2e565b5060c0820151816006015590505060019550505050505092915050565b60606000826040516020018080602001828103825283818151815260200191508051906020019080838360005b83811015611ec3578082015181840152602081019050611ea8565b50505050905090810190601f168015611ef05780820380516001836020036101000a031916815260200191505b5092505050604051602081830303815290604052805190602001209050606060046000838152602001908152602001600020805480602002602001604051908101604052809291908181526020018280548015611f6c57602002820191906000526020600020905b815481526020019060010190808311611f58575b505050505090508092505050919050565b60606000826040516020018080602001828103825283818151815260200191508051906020019080838360005b83811015611fc5578082015181840152602081019050611faa565b50505050905090810190601f168015611ff25780820380516001836020036101000a031916815260200191505b509250505060405160208183030381529060405280519060200120905060606003600083815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561206e57602002820191906000526020600020905b81548152602001906001019080831161205a575b505050505090508092505050919050565b60006060600260008481526020019081526020016000206006015460026000858152602001908152602001600020600501808054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156121455780601f1061211a57610100808354040283529160200191612145565b820191906000526020600020905b81548152906001019060200180831161212857829003601f168201915b5050505050905091509150915091565b600060608060608060006002600088815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506121a28782612710565b15156122015760008090506020604051908101604052806000815250602060405190810160405280600081525060206040519081016040528060008152506020604051908101604052806000815250955095509550955095505061250c565b6002600088815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660026000898152602001908152602001600020600101600260008a8152602001908152602001600020600201600260008b8152602001908152602001600020600301600260008c8152602001908152602001600020600401838054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123255780601f106122fa57610100808354040283529160200191612325565b820191906000526020600020905b81548152906001019060200180831161230857829003601f168201915b50505050509350828054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123c15780601f10612396576101008083540402835291602001916123c1565b820191906000526020600020905b8154815290600101906020018083116123a457829003601f168201915b50505050509250818054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561245d5780601f106124325761010080835404028352916020019161245d565b820191906000526020600020905b81548152906001019060200180831161244057829003601f168201915b50505050509150808054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124f95780601f106124ce576101008083540402835291602001916124f9565b820191906000526020600020905b8154815290600101906020018083116124dc57829003601f168201915b5050505050905095509550955095509550505b91939590929450565b60606000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125ec5780601f106125c1576101008083540402835291602001916125ec565b820191906000526020600020905b8154815290600101906020018083116125cf57829003601f168201915b50505050509050919050565b60606000826040516020018080602001828103825283818151815260200191508051906020019080838360005b83811015612640578082015181840152602081019050612625565b50505050905090810190601f16801561266d5780820380516001836020036101000a031916815260200191505b50925050506040516020818303038152906040528051906020012090506060600560008381526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156126e957602002820191906000526020600020905b8154815260200190600101908083116126d5575b505050505090508092505050919050565b6000806127078484612794565b14905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060009054906101000a900460ff16905092915050565b6000818301905082811015151561278b57fe5b80905092915050565b60006060839050606083905060008251905080825110156127b457815190505b60008090505b81811015612a005782818151811015156127d057fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916848281518110151561284b57fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610156128ea577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff945050505050612a54565b82818151811015156128f857fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916848281518110151561297357fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611156129f3576001945050505050612a54565b80806001019150506127ba565b50815183511015612a36577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9350505050612a54565b815183511115612a4c5760019350505050612a54565b600093505050505b92915050565b60e060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016060815260200160608152602001606081526020016060815260200160608152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612aef57805160ff1916838001178555612b1d565b82800160010185558215612b1d579182015b82811115612b1c578251825591602001919060010190612b01565b5b509050612b2a9190612bae565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612b6f57805160ff1916838001178555612b9d565b82800160010185558215612b9d579182015b82811115612b9c578251825591602001919060010190612b81565b5b509050612baa9190612bae565b5090565b612bd091905b80821115612bcc576000816000905550600101612bb4565b5090565b9056fea165627a7a72305820eebd0e825fa69cbad1ebb160084e3eef97605b4fdbf049a3c7aa6394763b217a0029"

// DeployMain deploys a new contract, binding an instance of Main to it.
func DeployMain(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Main, error) {
	parsed, err := abi.JSON(strings.NewReader(MainABI))
	if err != nil {
		return common.Address{}, nil, nil, err
	}

	address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(MainBin), backend)
	if err != nil {
		return common.Address{}, nil, nil, err
	}
	return address, tx, &Main{MainCaller: MainCaller{contract: contract}, MainTransactor: MainTransactor{contract: contract}, MainFilterer: MainFilterer{contract: contract}}, nil
}

func AsyncDeployMain(auth *bind.TransactOpts, handler func(*types.Receipt, error), backend bind.ContractBackend) (*types.Transaction, error) {
	parsed, err := abi.JSON(strings.NewReader(MainABI))
	if err != nil {
		return nil, err
	}

	tx, err := bind.AsyncDeployContract(auth, handler, parsed, common.FromHex(MainBin), backend)
	if err != nil {
		return nil, err
	}
	return tx, nil
}

// Main is an auto generated Go binding around a Solidity contract.
type Main struct {
	MainCaller     // Read-only binding to the contract
	MainTransactor // Write-only binding to the contract
	MainFilterer   // Log filterer for contract events
}

// MainCaller is an auto generated read-only Go binding around a Solidity contract.
type MainCaller struct {
	contract *bind.BoundContract // Generic contract wrapper for the low level calls
}

// MainTransactor is an auto generated write-only Go binding around a Solidity contract.
type MainTransactor struct {
	contract *bind.BoundContract // Generic contract wrapper for the low level calls
}

// MainFilterer is an auto generated log filtering Go binding around a Solidity contract events.
type MainFilterer struct {
	contract *bind.BoundContract // Generic contract wrapper for the low level calls
}

// MainSession is an auto generated Go binding around a Solidity contract,
// with pre-set call and transact options.
type MainSession struct {
	Contract     *Main             // Generic contract binding to set the session for
	CallOpts     bind.CallOpts     // Call options to use throughout this session
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

// MainCallerSession is an auto generated read-only Go binding around a Solidity contract,
// with pre-set call options.
type MainCallerSession struct {
	Contract *MainCaller   // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts // Call options to use throughout this session
}

// MainTransactorSession is an auto generated write-only Go binding around a Solidity contract,
// with pre-set transact options.
type MainTransactorSession struct {
	Contract     *MainTransactor   // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

// MainRaw is an auto generated low-level Go binding around a Solidity contract.
type MainRaw struct {
	Contract *Main // Generic contract binding to access the raw methods on
}

// MainCallerRaw is an auto generated low-level read-only Go binding around a Solidity contract.
type MainCallerRaw struct {
	Contract *MainCaller // Generic read-only contract binding to access the raw methods on
}

// MainTransactorRaw is an auto generated low-level write-only Go binding around a Solidity contract.
type MainTransactorRaw struct {
	Contract *MainTransactor // Generic write-only contract binding to access the raw methods on
}

// NewMain creates a new instance of Main, bound to a specific deployed contract.
func NewMain(address common.Address, backend bind.ContractBackend) (*Main, error) {
	contract, err := bindMain(address, backend, backend, backend)
	if err != nil {
		return nil, err
	}
	return &Main{MainCaller: MainCaller{contract: contract}, MainTransactor: MainTransactor{contract: contract}, MainFilterer: MainFilterer{contract: contract}}, nil
}

// NewMainCaller creates a new read-only instance of Main, bound to a specific deployed contract.
func NewMainCaller(address common.Address, caller bind.ContractCaller) (*MainCaller, error) {
	contract, err := bindMain(address, caller, nil, nil)
	if err != nil {
		return nil, err
	}
	return &MainCaller{contract: contract}, nil
}

// NewMainTransactor creates a new write-only instance of Main, bound to a specific deployed contract.
func NewMainTransactor(address common.Address, transactor bind.ContractTransactor) (*MainTransactor, error) {
	contract, err := bindMain(address, nil, transactor, nil)
	if err != nil {
		return nil, err
	}
	return &MainTransactor{contract: contract}, nil
}

// NewMainFilterer creates a new log filterer instance of Main, bound to a specific deployed contract.
func NewMainFilterer(address common.Address, filterer bind.ContractFilterer) (*MainFilterer, error) {
	contract, err := bindMain(address, nil, nil, filterer)
	if err != nil {
		return nil, err
	}
	return &MainFilterer{contract: contract}, nil
}

// bindMain binds a generic wrapper to an already deployed contract.
func bindMain(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
	parsed, err := abi.JSON(strings.NewReader(MainABI))
	if err != nil {
		return nil, err
	}
	return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}

// Call invokes the (constant) contract method with params as input values and
// sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named
// returns.
func (_Main *MainRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
	return _Main.Contract.MainCaller.contract.Call(opts, result, method, params...)
}

// Transfer initiates a plain transaction to move funds to the contract, calling
// its default method if one is available.
func (_Main *MainRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, *types.Receipt, error) {
	return _Main.Contract.MainTransactor.contract.Transfer(opts)
}

// Transact invokes the (paid) contract method with params as input values.
func (_Main *MainRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, *types.Receipt, error) {
	return _Main.Contract.MainTransactor.contract.Transact(opts, method, params...)
}

// Call invokes the (constant) contract method with params as input values and
// sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named
// returns.
func (_Main *MainCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
	return _Main.Contract.contract.Call(opts, result, method, params...)
}

// Transfer initiates a plain transaction to move funds to the contract, calling
// its default method if one is available.
func (_Main *MainTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, *types.Receipt, error) {
	return _Main.Contract.contract.Transfer(opts)
}

// Transact invokes the (paid) contract method with params as input values.
func (_Main *MainTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, *types.Receipt, error) {
	return _Main.Contract.contract.Transact(opts, method, params...)
}

// GetByHash is a free data retrieval call binding the contract method 0xcd16940b.
//
// Solidity: function GetByHash(string _fileHash) constant returns(bytes32[])
func (_Main *MainCaller) GetByHash(opts *bind.CallOpts, _fileHash string) ([][32]byte, error) {
	var (
		ret0 = new([][32]byte)
	)
	out := ret0
	err := _Main.contract.Call(opts, out, "GetByHash", _fileHash)
	return *ret0, err
}

// GetByHash is a free data retrieval call binding the contract method 0xcd16940b.
//
// Solidity: function GetByHash(string _fileHash) constant returns(bytes32[])
func (_Main *MainSession) GetByHash(_fileHash string) ([][32]byte, error) {
	return _Main.Contract.GetByHash(&_Main.CallOpts, _fileHash)
}

// GetByHash is a free data retrieval call binding the contract method 0xcd16940b.
//
// Solidity: function GetByHash(string _fileHash) constant returns(bytes32[])
func (_Main *MainCallerSession) GetByHash(_fileHash string) ([][32]byte, error) {
	return _Main.Contract.GetByHash(&_Main.CallOpts, _fileHash)
}

// GetById is a free data retrieval call binding the contract method 0xd7b451ec.
//
// Solidity: function GetById(string _fileId) constant returns(address user, string userId, string fileId, string fileHash, string fileSm3, string fileMd5, uint256 blkNum, string timeStamp)
func (_Main *MainCaller) GetById(opts *bind.CallOpts, _fileId string) (struct {
	User      common.Address
	UserId    string
	FileId    string
	FileHash  string
	FileSm3   string
	FileMd5   string
	BlkNum    *big.Int
	TimeStamp string
}, error) {
	ret := new(struct {
		User      common.Address
		UserId    string
		FileId    string
		FileHash  string
		FileSm3   string
		FileMd5   string
		BlkNum    *big.Int
		TimeStamp string
	})
	out := ret
	err := _Main.contract.Call(opts, out, "GetById", _fileId)
	return *ret, err
}

// GetById is a free data retrieval call binding the contract method 0xd7b451ec.
//
// Solidity: function GetById(string _fileId) constant returns(address user, string userId, string fileId, string fileHash, string fileSm3, string fileMd5, uint256 blkNum, string timeStamp)
func (_Main *MainSession) GetById(_fileId string) (struct {
	User      common.Address
	UserId    string
	FileId    string
	FileHash  string
	FileSm3   string
	FileMd5   string
	BlkNum    *big.Int
	TimeStamp string
}, error) {
	return _Main.Contract.GetById(&_Main.CallOpts, _fileId)
}

// GetById is a free data retrieval call binding the contract method 0xd7b451ec.
//
// Solidity: function GetById(string _fileId) constant returns(address user, string userId, string fileId, string fileHash, string fileSm3, string fileMd5, uint256 blkNum, string timeStamp)
func (_Main *MainCallerSession) GetById(_fileId string) (struct {
	User      common.Address
	UserId    string
	FileId    string
	FileHash  string
	FileSm3   string
	FileMd5   string
	BlkNum    *big.Int
	TimeStamp string
}, error) {
	return _Main.Contract.GetById(&_Main.CallOpts, _fileId)
}

// GetByIdHash is a free data retrieval call binding the contract method 0xe3b3655b.
//
// Solidity: function GetByIdHash(bytes32 _fileIdHash) constant returns(address user, string userId, string fileId, string fileHash, string fileSm3, string fileMd5, uint256 blkNum, string timeStamp)
func (_Main *MainCaller) GetByIdHash(opts *bind.CallOpts, _fileIdHash [32]byte) (struct {
	User      common.Address
	UserId    string
	FileId    string
	FileHash  string
	FileSm3   string
	FileMd5   string
	BlkNum    *big.Int
	TimeStamp string
}, error) {
	ret := new(struct {
		User      common.Address
		UserId    string
		FileId    string
		FileHash  string
		FileSm3   string
		FileMd5   string
		BlkNum    *big.Int
		TimeStamp string
	})
	out := ret
	err := _Main.contract.Call(opts, out, "GetByIdHash", _fileIdHash)
	return *ret, err
}

// GetByIdHash is a free data retrieval call binding the contract method 0xe3b3655b.
//
// Solidity: function GetByIdHash(bytes32 _fileIdHash) constant returns(address user, string userId, string fileId, string fileHash, string fileSm3, string fileMd5, uint256 blkNum, string timeStamp)
func (_Main *MainSession) GetByIdHash(_fileIdHash [32]byte) (struct {
	User      common.Address
	UserId    string
	FileId    string
	FileHash  string
	FileSm3   string
	FileMd5   string
	BlkNum    *big.Int
	TimeStamp string
}, error) {
	return _Main.Contract.GetByIdHash(&_Main.CallOpts, _fileIdHash)
}

// GetByIdHash is a free data retrieval call binding the contract method 0xe3b3655b.
//
// Solidity: function GetByIdHash(bytes32 _fileIdHash) constant returns(address user, string userId, string fileId, string fileHash, string fileSm3, string fileMd5, uint256 blkNum, string timeStamp)
func (_Main *MainCallerSession) GetByIdHash(_fileIdHash [32]byte) (struct {
	User      common.Address
	UserId    string
	FileId    string
	FileHash  string
	FileSm3   string
	FileMd5   string
	BlkNum    *big.Int
	TimeStamp string
}, error) {
	return _Main.Contract.GetByIdHash(&_Main.CallOpts, _fileIdHash)
}

// GetByMd5 is a free data retrieval call binding the contract method 0xf3a0f42a.
//
// Solidity: function GetByMd5(string _fileMd5) constant returns(bytes32[])
func (_Main *MainCaller) GetByMd5(opts *bind.CallOpts, _fileMd5 string) ([][32]byte, error) {
	var (
		ret0 = new([][32]byte)
	)
	out := ret0
	err := _Main.contract.Call(opts, out, "GetByMd5", _fileMd5)
	return *ret0, err
}

// GetByMd5 is a free data retrieval call binding the contract method 0xf3a0f42a.
//
// Solidity: function GetByMd5(string _fileMd5) constant returns(bytes32[])
func (_Main *MainSession) GetByMd5(_fileMd5 string) ([][32]byte, error) {
	return _Main.Contract.GetByMd5(&_Main.CallOpts, _fileMd5)
}

// GetByMd5 is a free data retrieval call binding the contract method 0xf3a0f42a.
//
// Solidity: function GetByMd5(string _fileMd5) constant returns(bytes32[])
func (_Main *MainCallerSession) GetByMd5(_fileMd5 string) ([][32]byte, error) {
	return _Main.Contract.GetByMd5(&_Main.CallOpts, _fileMd5)
}

// GetBySm3 is a free data retrieval call binding the contract method 0x99ac22f5.
//
// Solidity: function GetBySm3(string _fileSm3) constant returns(bytes32[])
func (_Main *MainCaller) GetBySm3(opts *bind.CallOpts, _fileSm3 string) ([][32]byte, error) {
	var (
		ret0 = new([][32]byte)
	)
	out := ret0
	err := _Main.contract.Call(opts, out, "GetBySm3", _fileSm3)
	return *ret0, err
}

// GetBySm3 is a free data retrieval call binding the contract method 0x99ac22f5.
//
// Solidity: function GetBySm3(string _fileSm3) constant returns(bytes32[])
func (_Main *MainSession) GetBySm3(_fileSm3 string) ([][32]byte, error) {
	return _Main.Contract.GetBySm3(&_Main.CallOpts, _fileSm3)
}

// GetBySm3 is a free data retrieval call binding the contract method 0x99ac22f5.
//
// Solidity: function GetBySm3(string _fileSm3) constant returns(bytes32[])
func (_Main *MainCallerSession) GetBySm3(_fileSm3 string) ([][32]byte, error) {
	return _Main.Contract.GetBySm3(&_Main.CallOpts, _fileSm3)
}

// Name is a free data retrieval call binding the contract method 0x8052474d.
//
// Solidity: function Name() constant returns(string)
func (_Main *MainCaller) Name(opts *bind.CallOpts) (string, error) {
	var (
		ret0 = new(string)
	)
	out := ret0
	err := _Main.contract.Call(opts, out, "Name")
	return *ret0, err
}

// Name is a free data retrieval call binding the contract method 0x8052474d.
//
// Solidity: function Name() constant returns(string)
func (_Main *MainSession) Name() (string, error) {
	return _Main.Contract.Name(&_Main.CallOpts)
}

// Name is a free data retrieval call binding the contract method 0x8052474d.
//
// Solidity: function Name() constant returns(string)
func (_Main *MainCallerSession) Name() (string, error) {
	return _Main.Contract.Name(&_Main.CallOpts)
}

// Version is a free data retrieval call binding the contract method 0xbb62860d.
//
// Solidity: function Version() constant returns(string)
func (_Main *MainCaller) Version(opts *bind.CallOpts) (string, error) {
	var (
		ret0 = new(string)
	)
	out := ret0
	err := _Main.contract.Call(opts, out, "Version")
	return *ret0, err
}

// Version is a free data retrieval call binding the contract method 0xbb62860d.
//
// Solidity: function Version() constant returns(string)
func (_Main *MainSession) Version() (string, error) {
	return _Main.Contract.Version(&_Main.CallOpts)
}

// Version is a free data retrieval call binding the contract method 0xbb62860d.
//
// Solidity: function Version() constant returns(string)
func (_Main *MainCallerSession) Version() (string, error) {
	return _Main.Contract.Version(&_Main.CallOpts)
}

// Add is a paid mutator transaction binding the contract method 0x68b7d4ae.
//
// Solidity: function Add(string userId, string fileId, string fileHash, string fileSm3, string fileMd5, string timestamp) returns(bool)
func (_Main *MainTransactor) Add(opts *bind.TransactOpts, userId string, fileId string, fileHash string, fileSm3 string, fileMd5 string, timestamp string) (*types.Transaction, *types.Receipt, error) {
	return _Main.contract.Transact(opts, "Add", userId, fileId, fileHash, fileSm3, fileMd5, timestamp)
}

func (_Main *MainTransactor) AsyncAdd(handler func(*types.Receipt, error), opts *bind.TransactOpts, userId string, fileId string, fileHash string, fileSm3 string, fileMd5 string, timestamp string) (*types.Transaction, error) {
	return _Main.contract.AsyncTransact(opts, handler, "Add", userId, fileId, fileHash, fileSm3, fileMd5, timestamp)
}

// Add is a paid mutator transaction binding the contract method 0x68b7d4ae.
//
// Solidity: function Add(string userId, string fileId, string fileHash, string fileSm3, string fileMd5, string timestamp) returns(bool)
func (_Main *MainSession) Add(userId string, fileId string, fileHash string, fileSm3 string, fileMd5 string, timestamp string) (*types.Transaction, *types.Receipt, error) {
	return _Main.Contract.Add(&_Main.TransactOpts, userId, fileId, fileHash, fileSm3, fileMd5, timestamp)
}

func (_Main *MainSession) AsyncAdd(handler func(*types.Receipt, error), userId string, fileId string, fileHash string, fileSm3 string, fileMd5 string, timestamp string) (*types.Transaction, error) {
	return _Main.Contract.AsyncAdd(handler, &_Main.TransactOpts, userId, fileId, fileHash, fileSm3, fileMd5, timestamp)
}

// Add is a paid mutator transaction binding the contract method 0x68b7d4ae.
//
// Solidity: function Add(string userId, string fileId, string fileHash, string fileSm3, string fileMd5, string timestamp) returns(bool)
func (_Main *MainTransactorSession) Add(userId string, fileId string, fileHash string, fileSm3 string, fileMd5 string, timestamp string) (*types.Transaction, *types.Receipt, error) {
	return _Main.Contract.Add(&_Main.TransactOpts, userId, fileId, fileHash, fileSm3, fileMd5, timestamp)
}

func (_Main *MainTransactorSession) AsyncAdd(handler func(*types.Receipt, error), userId string, fileId string, fileHash string, fileSm3 string, fileMd5 string, timestamp string) (*types.Transaction, error) {
	return _Main.Contract.AsyncAdd(handler, &_Main.TransactOpts, userId, fileId, fileHash, fileSm3, fileMd5, timestamp)
}

// MainNewIterator is returned from FilterNew and is used to iterate over the raw logs and unpacked data for New events raised by the Main contract.
type MainNewIterator struct {
	Event *MainNew // Event containing the contract specifics and raw log

	contract *bind.BoundContract // Generic contract to use for unpacking event data
	event    string              // Event name to use for unpacking event data

	logs chan types.Log        // Log channel receiving the found contract events
	sub  ethereum.Subscription // Subscription for errors, completion and termination
	done bool                  // Whether the subscription completed delivering logs
	fail error                 // Occurred error to stop iteration
}

// Next advances the iterator to the subsequent event, returning whether there
// are any more events found. In case of a retrieval or parsing error, false is
// returned and Error() can be queried for the exact failure.
func (it *MainNewIterator) Next() bool {
	// If the iterator failed, stop iterating
	if it.fail != nil {
		return false
	}
	// If the iterator completed, deliver directly whatever's available
	if it.done {
		select {
		case log := <-it.logs:
			it.Event = new(MainNew)
			if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
				it.fail = err
				return false
			}
			it.Event.Raw = log
			return true

		default:
			return false
		}
	}
	// Iterator still in progress, wait for either a data or an error event
	select {
	case log := <-it.logs:
		it.Event = new(MainNew)
		if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
			it.fail = err
			return false
		}
		it.Event.Raw = log
		return true

	case err := <-it.sub.Err():
		it.done = true
		it.fail = err
		return it.Next()
	}
}

// Error returns any retrieval or parsing error occurred during filtering.
func (it *MainNewIterator) Error() error {
	return it.fail
}

// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *MainNewIterator) Close() error {
	it.sub.Unsubscribe()
	return nil
}

// MainNew represents a New event raised by the Main contract.
type MainNew struct {
	UserAddr  common.Address
	FileId    common.Hash
	FileHash  common.Hash
	FileSm3   string
	FileMd5   string
	Timestamp string
	Raw       types.Log // Blockchain specific contextual infos
}

// FilterNew is a free log retrieval operation binding the contract event 0xfa733ea4d235b0fd772498c8094e129240609c36cb4da6df273418366eb3c3d5.
//
// Solidity: event New(address indexed userAddr, string indexed fileId, string indexed fileHash, string fileSm3, string fileMd5, string timestamp)
func (_Main *MainFilterer) FilterNew(opts *bind.FilterOpts, userAddr []common.Address, fileId []string, fileHash []string) (*MainNewIterator, error) {

	var userAddrRule []interface{}
	for _, userAddrItem := range userAddr {
		userAddrRule = append(userAddrRule, userAddrItem)
	}
	var fileIdRule []interface{}
	for _, fileIdItem := range fileId {
		fileIdRule = append(fileIdRule, fileIdItem)
	}
	var fileHashRule []interface{}
	for _, fileHashItem := range fileHash {
		fileHashRule = append(fileHashRule, fileHashItem)
	}

	logs, sub, err := _Main.contract.FilterLogs(opts, "New", userAddrRule, fileIdRule, fileHashRule)
	if err != nil {
		return nil, err
	}
	return &MainNewIterator{contract: _Main.contract, event: "New", logs: logs, sub: sub}, nil
}

// WatchNew is a free log subscription operation binding the contract event 0xfa733ea4d235b0fd772498c8094e129240609c36cb4da6df273418366eb3c3d5.
//
// Solidity: event New(address indexed userAddr, string indexed fileId, string indexed fileHash, string fileSm3, string fileMd5, string timestamp)
func (_Main *MainFilterer) WatchNew(opts *bind.WatchOpts, sink chan<- *MainNew, userAddr []common.Address, fileId []string, fileHash []string) (event.Subscription, error) {

	var userAddrRule []interface{}
	for _, userAddrItem := range userAddr {
		userAddrRule = append(userAddrRule, userAddrItem)
	}
	var fileIdRule []interface{}
	for _, fileIdItem := range fileId {
		fileIdRule = append(fileIdRule, fileIdItem)
	}
	var fileHashRule []interface{}
	for _, fileHashItem := range fileHash {
		fileHashRule = append(fileHashRule, fileHashItem)
	}

	logs, sub, err := _Main.contract.WatchLogs(opts, "New", userAddrRule, fileIdRule, fileHashRule)
	if err != nil {
		return nil, err
	}
	return event.NewSubscription(func(quit <-chan struct{}) error {
		defer sub.Unsubscribe()
		for {
			select {
			case log := <-logs:
				// New log arrived, parse the event and forward to the user
				event := new(MainNew)
				if err := _Main.contract.UnpackLog(event, "New", log); err != nil {
					return err
				}
				event.Raw = log

				select {
				case sink <- event:
				case err := <-sub.Err():
					return err
				case <-quit:
					return nil
				}
			case err := <-sub.Err():
				return err
			case <-quit:
				return nil
			}
		}
	}), nil
}

// ParseNew is a log parse operation binding the contract event 0xfa733ea4d235b0fd772498c8094e129240609c36cb4da6df273418366eb3c3d5.
//
// Solidity: event New(address indexed userAddr, string indexed fileId, string indexed fileHash, string fileSm3, string fileMd5, string timestamp)
func (_Main *MainFilterer) ParseNew(log types.Log) (*MainNew, error) {
	event := new(MainNew)
	if err := _Main.contract.UnpackLog(event, "New", log); err != nil {
		return nil, err
	}
	return event, nil
}
